﻿#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QQuickWidget>
#include<QHBoxLayout>
#include<QQuickView>


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
//    QQuickWidget *m_quickWidget=new QQuickWidget();
//    QUrl source("qrc:/Page.qml");
//    m_quickWidget->setSource(source);
//    this->setCentralWidget(m_quickWidget);
    QQuickItem *item = ui->quickWidget->rootObject();
    connect((QObject*)(item),SIGNAL(sendText(QString)),this,SLOT(receiveFromQml(QString)));
    connect(this,SIGNAL(sendToQml(QString)),(QObject*)(item),SIGNAL(receiveText(QString)));
    connect(ui->pushButton,&QPushButton::clicked,[this]
    {
        emit sendToQml("yangsen");
    });
}
MainWindow::~MainWindow()
{
    delete ui;
}



